package fr.labri.macchiato.core.api;

import java.util.List;

import fr.labri.macchiato.core.model.BusinessEntity;
import fr.labri.macchiato.core.model.Article;
import fr.labri.macchiato.core.model.Offer;
import fr.labri.macchiato.core.model.Product;
import fr.labri.macchiato.core.technical.Callback;

/**
 * Interface for any class able to fetch products from a database
 * 
 * @author Matthieu FOUCAULT
 *
 */
public interface Finder {
	
	/**
	 * Asynchronous call returning a list of {@link Article}s corresponding to a keyword
	 * @param keyword
	 * @param callback
	 */
	public void getArticles(String keyword, Callback<List<Article>> callback);

	/**
	 * Asynchronous call returning the {@link Offer}s for the given EAN and providers
	 * @param ean
	 * @param providers
	 * @param callback
	 */
	public void getOffers(String ean, List<BusinessEntity> providers, Callback<List<Offer>> callback);

	/**
	 * Asynchronous call returning the best offer for a {@link Product} 
	 * @param product
	 * @param preference
	 * @param callback
	 */
	public void getCheaperOffer(Product product, 
			Callback<Product> callback);
	
	/**
	 *  returns a list of the business entities in the database
	 * @param callback 
	 */
	void getBusinessEntities(Callback<List<BusinessEntity>> callback);

	public String getName();

	public String getUrlIcon();
}
